package com.water.expert.extraction.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.water.expert.extraction.repository.Expert;
import com.water.expert.extraction.repository.ExpertRepository;
import com.water.expert.extraction.repository.Profession;

@Service
public class ExpertService {
	@Autowired
	private ExpertRepository expertRepository;

	public Iterable<Expert> getAllExperts() {
		return expertRepository.findAll();
	}
	
	public List<Expert> getExpertByCurrentProfession(Profession currentProfession){
		return expertRepository.getByCurrentProfession(currentProfession);
	}

	public Iterable<Expert> saveAll(List<Expert> experts) {
		return expertRepository.saveAll(experts);
	}
}
